package com.twu.biblioteca;

public class Book {
    private String bookName;
    private User borrowedUser;

    public Book(String bookName) {
        this.bookName = bookName;
        this.borrowedUser = null;
    }

    public String getName() {
        return this.bookName;
    }

    @Override
    public boolean equals(Object o) {
        Book book = (Book) o;
        return this.bookName.equals(book.getName());
    }

    public User getBorrowedUser() {
        return borrowedUser;
    }

    public void setBorrowedUser(User borrowedUser) {
        this.borrowedUser = borrowedUser;
    }

    public Book getThisBook(String name) {
        if(name.equals(this.getName())) {
            return this;
        }
        return null;
    }
}
